lib.use(['element', 'table', 'form'], function () {
    var layer = layui.layer;
    var form = layui.form;
    var $ = layui.jquery;
    var addForm = layui.Form('addForm');

    form.verify({
        beanName: function(value, item){ //value：表单的值、item：表单的DOM对象
            if(!value){
                return 'Bean名称不能为空';
            }
        },
        cronExpression: function(value, item){ //value：表单的值、item：表单的DOM对象
            if(!value){
                return 'cron表达式不能为空';
            }
        }
    });
    form.on('submit(addFormSubmitFilter)', function (data) {
        var param = addForm.getData();
        console.log('schedule Save param is', param);
        ApiUtil.post('/sys/schedule/save', param, function (resp) {
            layer.alert('添加成功', function () {
                location.href = 'jobList.html';
            })
        })
        return false;
    });
});
